<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of data
 *
 * @author marcel
 */
class data {

    public static function dias($data) {
        preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/', $data, $matches);
        return $matches[3] . '/' . $matches[2] . '/' . $matches[1];
    }
    
    public static function formato1($data) {
        preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})/', $data, $matches);
        return $matches[3] . '/' . $matches[2] . '/' . $matches[1];
    }

    public static function dias_db($data) {
        preg_match('/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/', $data, $matches);
        return $matches[3] . '-' . $matches[2] . '-' . $matches[1];
    }

}

?>
